Reading queries topic
Four equal ways to read a query, with no recommended default; they mix freely in one screen. context.query (QueryContext) reads in any widget's build; QueryMixin.watchQuery reads in a State; QueryBuilder and QuerySelectBuilder rebuild exactly their subtree; QueryController is a plain ValueListenable for view models and code without widgets. Each takes a BuildWhen to narrow when it rebuilds.
Classes
-
QueryBuilder<
TData> Reading queries -
Builds its subtree from a query's result — the
StreamBuildershape. -
QueryController<
TQueryData, TData> Reading queries - One query, as a ValueListenable of its QueryResult.
-
QuerySelectBuilder<
TQueryData, TData> Reading queries -
QueryBuilder for a query with a
select: the cache holdsTQueryData, the builder seesTData.
Mixins
-
QueryMixin<
T extends StatefulWidget> Reading queries Mutations Infinite queries -
Adds watchQuery, watchSelectQuery, watchInfiniteQuery and
watchMutation to a State, to read queries flat in its
build.
Extensions
- QueryContext on BuildContext Reading queries Mutations Infinite queries
-
Reads queries and mutations straight from a BuildContext, in
build.
Typedefs
-
BuildWhen<
T> = bool Function(T previous, T current) Reading queries -
Whether a reader should rebuild for a change from
previoustocurrent— thebuildWhenevery call style takes.